package com.example.lemieripetizioni;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;

public class Login extends Activity {

	private Button buttonLoginActivity;
	Context ctx;

	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

		setContentView(R.layout.login);
		ctx = getApplicationContext();

		// We demonstrate three different ways of managing session login/logout
		// behavior:
		// 1) LoginUsingActivityActivity implements an Activity that handles all
		// of its own
		// session management.
		// 2) LoginUsingCustomFragmentActivity uses a Fragment that handles
		// session management;
		// this Fragment could be composed as part of a more complex Activity,
		// although in this
		// case it is the only UI that the Activity displays.
		// 3) LoginUsingLoginFragmentActivity is similar to
		// LoginUsingCustomFragmentActivity, but
		// uses the UserSettingsFragment class provided by the SDK to handle
		// session management. As
		// in (2), this Fragment could be composed as part of a more complex
		// Activity in a real app.
		buttonLoginActivity = (Button) findViewById(R.id.buttonLoginActivity);
		buttonLoginActivity.setOnClickListener(new View.OnClickListener() {
			@Override
			public void onClick(View v) {
				Intent intent = new Intent(Login.this, LoginUsingActivityActivity.class);
				startActivity(intent);

				// Bundle bundle = new Bundle();
				// bundle.putString("nome", "Pippo");
				// bundle.putString("cognome", "Pluto");
				// Intent intent = new Intent(Login.this, MainActivity.class);
				// intent.putExtras(bundle);
				// startActivity(intent);
			}
		});

		TextView login = (TextView) findViewById(R.id.registrati);
		login.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View viewIn) {

				Intent intent = new Intent(Login.this, Iscrizione.class);
				startActivity(intent);

			}
		});
	}
}
